#include <ros/ros.h>
#include <sensor_msgs/Range.h>

void rangeCallback(const sensor_msgs::Range::ConstPtr &msg) {
    ROS_INFO("Distance: %f", msg->range);
}

int main(int argc, char **argv) {
    ros::init(argc, argv, "cre_range_subscriber");
    ros::NodeHandle nh;
    ros::Subscriber sub = nh.subscribe<sensor_msgs::Range>("distance_sensor", 10, rangeCallback);
    ros::spin();
    return 0;
}
